package org.linlinjava.litemall.admin.web.order_manage;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.admin.service.order_manage.AgedmallUploadService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author wj
 * @date 2021/8/4 17:45
 */
@RestController
@RequestMapping("/upload")
public class AgedmallUploadController {


    @Resource
    private AgedmallUploadService agedmallUploadService;

    /**
     * 上传文件
     */
    @RequestMapping("/uploadFile")
    public Object uploadFile(@RequestParam("file") MultipartFile file,String path,Integer fileType) {
        return agedmallUploadService.uploadFile(file,path,fileType);
    }

    /**
     * 删除文件
     */
    @RequestMapping("/deleteFile/{fileId}")
    public Object deleteFile(@PathVariable String fileId){
        return agedmallUploadService.deleteFile(fileId);
    }

}
